﻿function ChooseGiftCart(displayButton)
{
    if(displayButton == null || displayButton == "False")
   {
        displayButton = 0;
   } 
    var giftCardPanel = document.getElementById("giftCartDiv");
    var chkCard = document.getElementById("_ctl0_ContentPlaceHolder2_chkGiftCard");
   var payButton = document.getElementById("button_div");
   var payValue = document.getElementById("payment_div");
    
    if (giftCardPanel==null || chkCard==null|| payButton == null || payValue == null)
        return;
    if (chkCard.checked == true)
    {
        giftCardPanel.style.display = "block";
        payButton.style.display = "block";
        payValue.style.display = "block";
    }
    else
   { 
        giftCardPanel.style.display = "none";
        if(!displayButton)
        {
          payButton.style.display = "none";
          payValue.style.display = "none"; 
        } 
    } 
    
}

function ChooseCashAccountPay()
{
    var chk = document.getElementById("_ctl0_ContentPlaceHolder2_chkCashAccount");
    var txt = document.getElementById("_ctl0_ContentPlaceHolder2_txtCashAccountPayment");
    if (txt == null)
        return;
    if (chk.checked == true)
        txt.disabled = false;
    else
        txt.disabled = true;
    
}

function ChooseGiftAccountPay()
{
    var chk = document.getElementById("_ctl0_ContentPlaceHolder2_chkGiftAccount");
    var txt = document.getElementById("_ctl0_ContentPlaceHolder2_txtGiftAccountPayment");
    if (txt==null )
        return;
    if (chk.checked == true)
        txt.disabled = false;
    else
        txt.disabled = true;
    
}

